Polymeric resin compositions including a maleic anhydride copolymer crosslinked with an amine crosslinker have been used to block fluid flow in siliceous and other natural rock formations. However, the presence of set cement, including Portland cement, typically inhibits the ability of these compositions to form crosslinked gels. In particular, when there is an unwanted gas or liquid flow through flow channels within a cement sheath behind a casing, or via a microannulular flow channel between cement sheath and a metal casing, resin based gel compositions in contact with the set cement may not demonstrate the desired sealing.